package ro.ase.catalog.security.dao.hibernate;

import ro.ase.catalog.beans.SchoolClass;
import ro.ase.catalog.beans.Student;
import ro.ase.catalog.dao.hibernate.GenericDAOImpl;
import ro.ase.catalog.security.dao.ISchoolClassDAO;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Ioana
 * Date: 5/12/14
 * Time: 5:54 PM
 * To change this template use File | Settings | File Templates.
 */
public class SchoolClassDAOImpl extends GenericDAOImpl<SchoolClass, Integer> implements ISchoolClassDAO{
    public SchoolClass findByName(String s) {
        List<SchoolClass> schoolClassList=getHibernateTemplate().find("select pv from SchoolClass pv where pv.name = ?", s );
        if(schoolClassList.size()!=0)
        return schoolClassList.get(0);
        else return null;
    }
}
